package com.jiajia.datasource;

/**
 * @author zjiajia
 * @date 2024/7/9 14:25
 */
public class DynamicDatasourceContextHolder {

    private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();

    public static void setDataSourceType(String type) {
        CONTEXT_HOLDER.set(type);
    }

    public static String getDataSourceType() {
        return CONTEXT_HOLDER.get();
    }

    public static void clearDataSourceType() {
        CONTEXT_HOLDER.remove();
    }
}
